
import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";
import { UserStatus } from "../dto/user.dto";

@Entity()
export class UserInfo{
    @PrimaryGeneratedColumn({type:'int',name:'id',comment:"用户自增id"})
    id:number;

    @Index('user_id')
    @Column({type:'int',comment:"用户编号"})
    userid:number;

    @Index('user_phone')
    @Column('varchar',{length:11,comment:"用户手机号码"})
    phone:string;

    @Index('user_username')
    @Column('varchar',{length:64,comment:'用户名'})
    username:string;

    @Column('varchar',{length:512,comment:'用户头像地址',default:"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-776e8598-8d62-46b9-b30d-7f25174ab0d5/2669785c-f300-4136-857e-115b7857bc22.png"})
    headimg:string;

    @Column({type:'decimal',scale:2,default:0,comment:"货币-合伙币(点)"})
    currency:number;

    @Column('varchar',{length:64,comment:'用户密码',name:'password',nullable:true})
    password:string|null;

    @Index('user_open_id')
    @Column('varchar',{length:128,comment:'第三方平台id',nullable:true})
    openid:string;

    @Column({type:'int',comment:"用户状态",default:UserStatus.NORMAL})
    status:number;

    @Column({type:'int',default:0,comment:"会员等级-不同等级的会员权益不同"})
    level:number;

    @Column({type:'int',comment:'注册时间戳'})
    regtime:number;

    @Column({type:'int',comment:'最后登录时间戳'})
    lasttime:number;

    @Column('varchar',{length:21,nullable:true})
    ip:string;
}
